<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    Cellphonezone
 * @package     Cellphonezone_Repay
 * @copyright   Copyright (c) 2010 Cellphonezone 
 * @author $Id$
 */
class Cellphonezone_Repay_Block_Adminhtml_Sales_Order_Creditmemo_Create_Adjustments extends Mage_Adminhtml_Block_Sales_Order_Creditmemo_Create_Adjustments
{
    /**
     * Initialize creditmemo agjustment totals
     *
     * @return Mage_Tax_Block_Sales_Order_Tax
     */
    public function initTotals()
    {
        $parent = $this->getParentBlock();
        $this->_source  = $parent->getSource();
        $total = new Varien_Object(array(
            'code'      => 'agjustments',
            'block_name'=> $this->getNameInLayout()
        ));
        $parent->removeTotal('shipping');
		$parent->removeTotal('payment');
        $parent->removeTotal('adjustment_positive');
        $parent->removeTotal('adjustment_negative');
        $parent->addTotal($total);
        return $this;
    }

    /**
     * Get credit memo payment amount depend on configuration settings
     * @return float
     */
    public function getPaymentAmount()
    {
        $source = $this->getSource();
        $payment = $source->getBasePaymentAmount();
        return Mage::app()->getStore()->roundPrice($payment) * 1;
    }

    /**
     * Get label for payment total based on configuration settings
     * @return string
     */
    public function getPaymentLabel()
    {
         $label = $this->helper('sales')->__('Refund surcharge');
        return $label;
    }
}
